<template>
  <div>
    <ul>
      <li v-for="item in data" :key="item.id">
        <!-- 把item的值传递给父组件，名称是data -->
        <slot :data="item">{{ item.name }}</slot>
      </li>
    </ul>
  </div>
</template>
<script>
export default {
  name: 'MyTreeTest',
  props: {
    data: {
      type: Array,
      default: () => []
    }
  }
}
</script>
